import request from '@/utils/request';
import type { ResponseType } from '@/type/ResponseType';
import { Address } from '@/type/AddressType';

enum Enum {
  fetchAddressListAPI = '/patient/order/address',
  deleteAddressAPI = '/patient/order/address'
}

/**
 * @description 获取收货地址列表的接口
 * */
export const fetchAddressListAPI = () => request.get<Address[], ResponseType<Address[]>>(Enum.fetchAddressListAPI);

/**
 * @description 删除收货地址的接口
 * */
export const deleteAddressAPI = (addressId: string) => request.delete<{ id: string }, ResponseType<{ id: string }>>(`${Enum.deleteAddressAPI}/${addressId}`);